package com.kang.controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.kang.bean.bot.Subject;
import com.kang.commons.Result;
import com.kang.service.subject.SubjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @program: service
 * @description:
 * @author: K.faWu
 * @create: 2022-04-29 14:22
 **/
@RestController
@RequestMapping("subject")
@Slf4j
public class SubjectController {
    private final SubjectService subjectService;

    public SubjectController(SubjectService subjectService) {
        this.subjectService = subjectService;
    }

    @PostMapping("/getList")
    public Result<?> getList(@RequestBody Subject subject, Page<?> page){
        PageInfo<Subject> pageInfo = subjectService.getList(subject, page);
        return Result.success(pageInfo);
    }

}
